package com.sina.weibo;

import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.res.Resources;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.view.Display;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import com.sina.weibo.models.Account;
import com.sina.weibo.models.User;
import java.io.File;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;

public class SwitchUser extends BaseActivity
{
  public static final int ALREADY_REGIST = 2;
  static final int FAMOUS = 4;
  static final int FILLINFO = 0;
  public static final int HOT_WORD = 2;
  public static final String KEY_NEW_COMMER = "new_commer";
  public static final int LOGIN_PARSE_FAILED = 2;
  public static final int LOOK_AROUND = 0;
  public static final int REFRESH_USER_LIST = 3;
  static final int REGISTER = 1;
  public static final int REGIST_COMPLETE = 1;
  public static final int REGIST_FAILED = 0;
  public static final int REGIST_NORMAL = 1;
  public static final int REGIST_WHITELIST = 0;
  static final int RETRIVE = 3;
  public static final int SWITCH_USER_FAILED = 1;
  public static final int SWITCH_USER_OK = 0;
  public static final int TOP_USER = 1;
  public static final String USRNAMELISTPATH = "/usrnamelistcache";
  public static final String WEIBO_SWITCH_ADD_NEW = "com.sina.weibo.action.add_new_account";
  static final int WL_FILLINFO = 2;
  public static List<Account> mAccounts;
  public static boolean mCurrentNewAccount = 0;
  private Button bnLogin;
  private EditText etPassword;
  private AutoCompleteTextView etUsrname;
  Handler handler;
  private boolean isAdd = 0;
  CharSequence mError;
  ListView mLvLinks;
  Dialog mPgDialog;
  LoginTask mTask;
  boolean mTaskFree;
  private int registMode = 0;
  private RegisterTask registTask;
  private boolean registTaskFree = 1;
  User tUser;
  List<String> usrList;
  private ArrayAdapter<String> usrnameAdapter;
  HashSet<String> usrnames;

  public SwitchUser()
  {
    SwitchUser.1 local1 = new SwitchUser.1(this);
    this.handler = local1;
  }

  public static boolean Login(String paramString1, String paramString2, Context paramContext)
  {
    try
    {
      List localList = AccountHelper.loadAccounts(paramContext);
      Account localAccount = AccountHelper.findAccount(localList, paramString1);
      if (localAccount == null)
      {
        localAccount = new Account();
        localAccount.user = paramString1;
      }
      User localUser = RPCHelper.getInstance(paramContext).login(paramString1, paramString2);
      localAccount.pass = paramString2;
      String str = localUser.nick;
      localAccount.nick = str;
      AccountHelper.addOrSortAccount(localList, localAccount);
      AccountHelper.saveAccounts(paramContext, localList);
      writeUser(paramString1, paramString2, localUser, paramContext);
      i = 1;
      return i;
    }
    catch (Exception localException)
    {
      while (true)
        int i = 0;
    }
  }

  private void closeProgress(Boolean paramBoolean)
  {
    this.mPgDialog.dismiss();
    if (paramBoolean.booleanValue())
      if (this.tUser.status == 1)
      {
        Utils.setLoginStatus(1);
        User localUser1 = this.tUser;
        String str = getCacheDir().getPath();
        Utils.saveUserFile(localUser1, str, this);
        Intent localIntent1 = new Intent("sina.weibo.action.SWITCHUSERDONE");
        sendBroadcast(localIntent1);
        Intent localIntent2 = new Intent("com.sina.weibo.action.SWITCHUSER");
        sendBroadcast(localIntent2);
        if (this.isAdd)
        {
          MainTabActivity.mMode = 0;
          Intent localIntent3 = new Intent(this, MainTabActivity.class);
          Intent localIntent4 = localIntent3.setAction("sina.weibo.action.UPDATEHOME");
          Intent localIntent5 = localIntent3.putExtra("MODE_KEY", 0);
          startActivity(localIntent3);
          finish();
        }
      }
    while (true)
    {
      return;
      setResult(-1, null);
      MainTabActivity.mMode = 0;
      finish();
      continue;
      Intent localIntent6 = new Intent(this, FillInfoActivity.class);
      User localUser2 = this.tUser;
      Intent localIntent7 = localIntent6.putExtra("USER", localUser2);
      startActivityForResult(localIntent6, 0);
      continue;
      CharSequence localCharSequence = this.mError;
      Toast.makeText(this, localCharSequence, 0).show();
    }
  }

  private boolean delSelectedUser(Account paramAccount)
  {
    if (mAccounts.indexOf(paramAccount) == 0)
      Utils.setLoginStatus(0);
    boolean bool1 = mAccounts.remove(paramAccount);
    SharedPreferences localSharedPreferences = getSharedPreferences("weibo", 0);
    String str1 = paramAccount.user;
    String str2 = localSharedPreferences.getString("username", "");
    SharedPreferences.Editor localEditor1;
    if (str1.equals(str2))
    {
      localEditor1 = localSharedPreferences.edit();
      if (mAccounts.size() <= 0)
        break label184;
      String str3 = ((Account)mAccounts.get(0)).user;
      SharedPreferences.Editor localEditor2 = localEditor1.putString("username", str3);
      String str4 = ((Account)mAccounts.get(0)).pass;
      SharedPreferences.Editor localEditor3 = localEditor1.putString("password", str4);
    }
    while (true)
    {
      boolean bool2 = localEditor1.commit();
      Utils.cleanUserFile(getCacheDir().getPath());
      StaticInfo.mUser = null;
      StaticInfo.mPassword = null;
      StaticInfo.mUsername = null;
      StaticInfo.mTotals = null;
      return bool1;
      label184: SharedPreferences.Editor localEditor4 = localEditor1.putString("username", "");
      SharedPreferences.Editor localEditor5 = localEditor1.putString("password", "");
    }
  }

  private void doItemMenu(int paramInt, Account paramAccount)
  {
    switch (paramInt)
    {
    default:
    case 0:
    case 1:
    }
    while (true)
    {
      return;
      View localView = LayoutInflater.from(this).inflate(2130903041, null);
      EditText localEditText1 = (EditText)localView.findViewById(2131623941);
      String str1 = paramAccount.user;
      localEditText1.setText(str1);
      EditText localEditText2 = (EditText)localView.findViewById(2131623942);
      String str2 = paramAccount.pass;
      localEditText2.setText(str2);
      AlertDialog.Builder localBuilder1 = new AlertDialog.Builder(this).setTitle(2131427413).setView(localView);
      SwitchUser.5 local5 = new SwitchUser.5(this, localEditText1, localEditText2, paramAccount);
      AlertDialog.Builder localBuilder2 = localBuilder1.setPositiveButton(2131427441, local5);
      SwitchUser.6 local6 = new SwitchUser.6(this);
      localBuilder2.setNegativeButton(2131427436, local6).create().show();
      continue;
      boolean bool1 = delSelectedUser(paramAccount);
      if (mAccounts.size() == 0)
      {
        Intent localIntent1 = new Intent("sina.weibo.action.NOUSER");
        sendBroadcast(localIntent1);
      }
      Intent localIntent2 = new Intent("com.sina.weibo.action.SWITCHUSER");
      sendBroadcast(localIntent2);
      List localList = mAccounts;
      AccountHelper.saveAccounts(this, localList);
      String str3 = getString(2131427405);
      Toast.makeText(this, str3, 0).show();
      Message localMessage = new Message();
      localMessage.what = 3;
      boolean bool2 = this.handler.sendMessage(localMessage);
    }
  }

  private boolean doRegister()
  {
    if ((NetworkUtil.getAPN(getApplication()).apn != null) && (NetworkUtil.getAPN(getApplication()).apn.equalsIgnoreCase("cmwap")))
    {
      this.registMode = 0;
      if (this.registTaskFree)
      {
        RegisterTask localRegisterTask1 = new RegisterTask();
        this.registTask = localRegisterTask1;
        RegisterTask localRegisterTask2 = this.registTask;
        String[] arrayOfString = new String[1];
        arrayOfString[0] = "";
        AsyncTask localAsyncTask = localRegisterTask2.execute(arrayOfString);
      }
    }
    while (true)
    {
      return false;
      Intent localIntent = new Intent(this, RegisterActivity.class);
      startActivityForResult(localIntent, 0);
    }
  }

  private String[] readCurUser()
  {
    SharedPreferences localSharedPreferences = getSharedPreferences("weibo", 0);
    String[] arrayOfString = new String[2];
    String str1 = localSharedPreferences.getString("username", null);
    arrayOfString[0] = str1;
    String str2 = localSharedPreferences.getString("password", null);
    arrayOfString[1] = str2;
    return arrayOfString;
  }

  private void showItemMenu(Account paramAccount)
  {
    AlertDialog.Builder localBuilder1 = new AlertDialog.Builder(this);
    AlertDialog.Builder localBuilder2 = localBuilder1.setTitle(2131427366);
    SwitchUser.4 local4 = new SwitchUser.4(this, paramAccount);
    AlertDialog.Builder localBuilder3 = localBuilder1.setItems(2131165194, local4);
    localBuilder1.create().show();
  }

  private void showProgress(int paramInt)
  {
    String str = getResources().getString(paramInt);
    ProgressDialog localProgressDialog = ProgressDialog.show(this, null, str, 1);
    this.mPgDialog = localProgressDialog;
    Dialog localDialog = this.mPgDialog;
    SwitchUser.7 local7 = new SwitchUser.7(this);
    localDialog.setOnKeyListener(local7);
  }

  private void writeCurUser(String paramString1, String paramString2)
  {
    User localUser = this.tUser;
    writeUser(paramString1, paramString2, localUser, this);
  }

  private static void writeUser(String paramString1, String paramString2, User paramUser, Context paramContext)
  {
    StaticInfo.mUser = paramUser;
    StaticInfo.mPassword = paramString2;
    StaticInfo.mUsername = paramString1;
    SharedPreferences.Editor localEditor1 = paramContext.getSharedPreferences("weibo", 0).edit();
    SharedPreferences.Editor localEditor2 = localEditor1.putString("username", paramString1);
    SharedPreferences.Editor localEditor3 = localEditor1.putString("password", paramString2);
    boolean bool = localEditor1.commit();
  }

  protected void handleTitleBarEvent(int paramInt)
  {
    switch (paramInt)
    {
    default:
    case 0:
    case 1:
    }
    while (true)
    {
      return;
      boolean bool = doRegister();
      continue;
      finish();
    }
  }

  protected void onActivityResult(int paramInt1, int paramInt2, Intent paramIntent)
  {
    if (paramInt2 != -1);
    while (true)
    {
      return;
      switch (paramInt1)
      {
      case 3:
      default:
        break;
      case 0:
      case 2:
        User localUser1 = StaticInfo.mUser;
        this.tUser = localUser1;
        User localUser2 = StaticInfo.mUser;
        this.tUser = localUser2;
        String str1 = paramIntent.getStringExtra("com.sina.weibo.RegisterActivity1.NICKNAME");
        String str2 = paramIntent.getStringExtra("com.sina.weibo.RegisterActivity1.USRNAME");
        String str3 = paramIntent.getStringExtra("com.sina.weibo.RegisterActivity1.PASSWORD");
        if ((str2 != null) && (str2.length() != 0))
          StaticInfo.mUser.status = 1;
        User localUser3 = StaticInfo.mUser;
        String str4 = getCacheDir().getAbsolutePath();
        Utils.saveUserFile(localUser3, str4, this);
        Account localAccount = AccountHelper.findAccount(mAccounts, str2);
        if (localAccount == null)
        {
          localAccount = new Account();
          localAccount.user = str2;
        }
        localAccount.nick = str1;
        localAccount.pass = str3;
        localAccount.user = str2;
        AccountHelper.addOrSortAccount(mAccounts, localAccount);
        List localList = mAccounts;
        AccountHelper.saveAccounts(this, localList);
        String str5 = localAccount.user;
        String str6 = localAccount.pass;
        writeCurUser(str5, str6);
        this.tUser.nick = str1;
        User localUser4 = this.tUser;
        String str7 = getCacheDir().getPath();
        Utils.saveUserFile(localUser4, str7, this);
        mCurrentNewAccount = 1;
        Intent localIntent1 = new Intent(this, LookAroundListActivity.class);
        MainTabActivity.mMode = 8;
        Intent localIntent2 = localIntent1.putExtra("mode", 8);
        Intent localIntent3 = localIntent1.putExtra("new_commer", 1);
        startActivityForResult(localIntent1, 4);
        break;
      case 1:
        if ((paramIntent == null) || (!this.mTaskFree))
          continue;
        LoginTask localLoginTask1 = new LoginTask();
        this.mTask = localLoginTask1;
        LoginTask localLoginTask2 = this.mTask;
        String[] arrayOfString = new String[2];
        String str8 = String.valueOf(paramIntent.getStringExtra("com.sina.weibo.RegisterActivity1.USRNAME"));
        String str9 = str8 + "@3g.sina.cn";
        arrayOfString[0] = str9;
        String str10 = paramIntent.getStringExtra("com.sina.weibo.RegisterActivity1.PASSWORD");
        arrayOfString[1] = str10;
        AsyncTask localAsyncTask = localLoginTask2.execute(arrayOfString);
        Intent localIntent4 = new Intent("com.sina.weibo.action.SWITCHUSER");
        sendBroadcast(localIntent4);
        break;
      case 4:
        Utils.setLoginStatus(1);
        User localUser5 = this.tUser;
        String str11 = getCacheDir().getPath();
        Utils.saveUserFile(localUser5, str11, this);
        Utils.cleanHomeListFile(null, null);
        Intent localIntent5 = new Intent("sina.weibo.action.SWITCHUSERDONE");
        sendBroadcast(localIntent5);
        Intent localIntent6 = new Intent("com.sina.weibo.action.SWITCHUSER");
        sendBroadcast(localIntent6);
        setResult(-1, null);
        finish();
      }
    }
  }

  public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    if (getIntent().getAction() == null)
    {
      int i = 0;
      this.isAdd = i;
      setView(2130903083);
      if (!this.isAdd)
        break label506;
      String str1 = getString(2131427528);
      String str2 = getString(2131427347);
      setTitleBar(1, str1, str2, null);
      label63: this.mTaskFree = 1;
      String str3 = String.valueOf(getCacheDir().getAbsolutePath());
      HashSet localHashSet3 = (HashSet)Utils.loadUsrnameList(str3 + "/usrnamelistcache");
      this.usrnames = localHashSet3;
      if (this.usrnames != null)
        break label537;
    }
    label506: HashSet localHashSet2;
    label537: for (HashSet localHashSet1 = new HashSet(); ; localHashSet2 = this.usrnames)
    {
      this.usrnames = localHashSet1;
      EditText localEditText = (EditText)findViewById(2131624124);
      this.etPassword = localEditText;
      AutoCompleteTextView localAutoCompleteTextView1 = (AutoCompleteTextView)findViewById(2131624122);
      this.etUsrname = localAutoCompleteTextView1;
      AutoCompleteTextView localAutoCompleteTextView2 = this.etUsrname;
      HashSet localHashSet4 = this.usrnames;
      ArrayList localArrayList1 = new ArrayList(localHashSet4);
      this.usrList = localArrayList1;
      ArrayAdapter localArrayAdapter = new ArrayAdapter(this, 17367050, localArrayList1);
      this.usrnameAdapter = localArrayAdapter;
      localAutoCompleteTextView2.setAdapter(localArrayAdapter);
      Button localButton1 = (Button)findViewById(2131624125);
      this.bnLogin = localButton1;
      Button localButton2 = this.bnLogin;
      SwitchUser.2 local2 = new SwitchUser.2(this);
      localButton2.setOnClickListener(local2);
      mAccounts = AccountHelper.loadAccounts(this);
      ArrayList localArrayList2 = new ArrayList();
      String str4 = getString(2131427416);
      boolean bool1 = localArrayList2.add(str4);
      String str5 = getString(2131427417);
      boolean bool2 = localArrayList2.add(str5);
      String str6 = getString(2131427418);
      boolean bool3 = localArrayList2.add(str6);
      SquareItemAdapter localSquareItemAdapter = new SquareItemAdapter(this);
      ListView localListView1 = (ListView)findViewById(2131624128);
      this.mLvLinks = localListView1;
      this.mLvLinks.setDivider(null);
      this.mLvLinks.setAdapter(localSquareItemAdapter);
      ListView localListView2 = this.mLvLinks;
      SwitchUser.3 local3 = new SwitchUser.3(this);
      localListView2.setOnItemClickListener(local3);
      Display localDisplay = ((WindowManager)getSystemService("window")).getDefaultDisplay();
      int k = localDisplay.getWidth();
      int m = localDisplay.getHeight();
      InputMethodManager localInputMethodManager = (InputMethodManager)getSystemService("input_method");
      if (localInputMethodManager != null)
      {
        IBinder localIBinder = this.etUsrname.getWindowToken();
        boolean bool4 = localInputMethodManager.hideSoftInputFromWindow(localIBinder, 2);
      }
      return;
      if (getIntent().getAction().equals("com.sina.weibo.action.add_new_account"))
      {
        j = 1;
        break;
      }
      int j = 0;
      break;
      String str7 = getString(2131427347);
      String str8 = getString(2131427753);
      setTitleBar(1, null, str7, str8);
      break label63;
    }
  }

  public boolean onCreateOptionsMenu(Menu paramMenu)
  {
    getMenuInflater().inflate(2131558402, paramMenu);
    return true;
  }

  protected void onDestroy()
  {
    System.err.println("on destroy.........");
    super.onDestroy();
  }

  public boolean onKeyDown(int paramInt, KeyEvent paramKeyEvent)
  {
    if ((paramInt == 4) && (mAccounts.size() == 0))
    {
      MainTabActivity.mWeiboFinish = 1;
      setResult(0, null);
      finish();
    }
    boolean bool;
    for (int i = 0; ; bool = super.onKeyDown(paramInt, paramKeyEvent))
    {
      return i;
      if ((paramInt != 4) || (mAccounts.size() == 0))
        continue;
      Utils.setLoginStatus(1);
      setResult(-1, null);
    }
  }

  public boolean onOptionsItemSelected(MenuItem paramMenuItem)
  {
    int i;
    switch (paramMenuItem.getItemId())
    {
    default:
      i = 0;
    case 2131624242:
    case 2131624243:
    case 2131624244:
    }
    while (true)
    {
      return i;
      Intent localIntent1 = new Intent("sina.weibo.action.SETTING");
      sendBroadcast(localIntent1);
      Intent localIntent2 = new Intent(this, SettingsPref.class);
      startActivity(localIntent2);
      i = 1;
      continue;
      Intent localIntent3 = new Intent(this, RetrivePwdActivity.class);
      startActivityForResult(localIntent3, 3);
      i = 1;
      continue;
      Intent localIntent4 = new Intent(this, AboutActivity.class);
      startActivity(localIntent4);
      i = 1;
    }
  }

  public void onPause()
  {
    super.onPause();
    MainTabActivity.mSwitchUserOnTop = 0;
    if ((!this.mTaskFree) && (this.mTask != null) && (!this.mTask.isCancelled()))
    {
      this.mPgDialog.dismiss();
      boolean bool = this.mTask.cancel(1);
      this.mTaskFree = 1;
    }
  }

  public void onResume()
  {
    super.onResume();
    if ((MainTabActivity.mMode == 9) || (MainTabActivity.mMode == 10) || (MainTabActivity.mMode == 11))
      MainTabActivity.mMode = 0;
    if ((mAccounts == null) || (mAccounts.size() == 0))
      mAccounts = AccountHelper.loadAccounts(this);
    MainTabActivity.mSwitchUserOnTop = 1;
  }

  public class LoginTask extends AsyncTask<String, Void, Boolean>
  {
    public LoginTask()
    {
    }

    protected Boolean doInBackground(String[] paramArrayOfString)
    {
      String str1 = Utils.trim(paramArrayOfString[0]);
      String str2 = Utils.trim(paramArrayOfString[1]);
      try
      {
        SwitchUser localSwitchUser1 = SwitchUser.this;
        User localUser = RPCHelper.getInstance(SwitchUser.this.getApplication()).login(str1, str2);
        localSwitchUser1.tUser = localUser;
        if ((SwitchUser.this.tUser.gsid == null) || (SwitchUser.this.tUser.uid == null))
        {
          SwitchUser localSwitchUser2 = SwitchUser.this;
          String str3 = SwitchUser.this.getString(2131427410);
          localSwitchUser2.mError = str3;
        }
        for (localBoolean = Boolean.valueOf(0); ; localBoolean = Boolean.valueOf(1))
        {
          return localBoolean;
          Account localAccount = AccountHelper.findAccount(SwitchUser.mAccounts, str1);
          if (localAccount == null)
          {
            localAccount = new Account();
            localAccount.user = str1;
          }
          localAccount.pass = str2;
          String str4 = SwitchUser.this.tUser.nick;
          localAccount.nick = str4;
          AccountHelper.addOrSortAccount(SwitchUser.mAccounts, localAccount);
          SwitchUser localSwitchUser3 = SwitchUser.this;
          List localList = SwitchUser.mAccounts;
          AccountHelper.saveAccounts(localSwitchUser3, localList);
          SwitchUser.this.writeCurUser(str1, str2);
          Utils.cleanHomeListFile(null, null);
          SwitchUser.this.mError = null;
        }
      }
      catch (RPCHelper.HttpException localHttpException)
      {
        while (true)
        {
          Message localMessage = SwitchUser.this.handler.obtainMessage();
          localMessage.what = 1;
          boolean bool = SwitchUser.this.handler.sendMessage(localMessage);
          SwitchUser localSwitchUser4 = SwitchUser.this;
          SwitchUser localSwitchUser5 = SwitchUser.this;
          Throwable localThrowable = Utils.getRootCause(localHttpException);
          String str5 = Utils.translationThrowable(localSwitchUser5, localThrowable);
          localSwitchUser4.mError = str5;
          Boolean localBoolean = Boolean.valueOf(0);
        }
      }
    }

    protected void onCancelled()
    {
      SwitchUser.this.mTaskFree = 1;
    }

    protected void onPostExecute(Boolean paramBoolean)
    {
      SwitchUser.this.closeProgress(paramBoolean);
      SwitchUser.this.mTaskFree = 1;
    }

    protected void onPreExecute()
    {
      SwitchUser.this.mTaskFree = 0;
      SwitchUser.this.showProgress(2131427421);
    }
  }

  public class RegisterTask extends AsyncTask<String, Void, Integer>
  {
    String password;
    String usrname;

    public RegisterTask()
    {
    }

    protected Integer doInBackground(String[] paramArrayOfString)
    {
      int i = 0;
      Object localObject = (Object[])0;
      switch (SwitchUser.this.registMode)
      {
      default:
      case 0:
      }
      while (true)
      {
        return Integer.valueOf(i);
        int j = 0;
        if ((j >= 5) || (i == 1))
          continue;
        if (i == 0);
        try
        {
          Object[] arrayOfObject = RPCHelper.getInstance(SwitchUser.this.getApplication()).registerByWhiteList();
          localObject = arrayOfObject;
          label73: if ((localObject != null) && (localObject[0] != 0))
          {
            String str1 = (String)localObject[1];
            StaticInfo.mUser = (User)localObject[0];
            SwitchUser localSwitchUser1 = SwitchUser.this;
            User localUser = StaticInfo.mUser;
            localSwitchUser1.tUser = localUser;
            StaticInfo.mUsername = StaticInfo.mUser.uid;
            StaticInfo.mPassword = str1;
            i = 1;
            List localList1 = SwitchUser.mAccounts;
            String str2 = StaticInfo.mUser.nick;
            Account localAccount = AccountHelper.findAccount(localList1, str2);
            if (localAccount == null)
            {
              localAccount = new Account();
              String str3 = StaticInfo.mUser.nick;
              localAccount.user = str3;
            }
            localAccount.pass = str1;
            String str4 = StaticInfo.mUser.nick;
            localAccount.nick = str4;
            AccountHelper.addOrSortAccount(SwitchUser.mAccounts, localAccount);
            SwitchUser localSwitchUser2 = SwitchUser.this;
            List localList2 = SwitchUser.mAccounts;
            AccountHelper.saveAccounts(localSwitchUser2, localList2);
            SwitchUser localSwitchUser3 = SwitchUser.this;
            String str5 = StaticInfo.mUser.nick;
            localSwitchUser3.writeCurUser(str5, str1);
          }
          do
          {
            j += 1;
            break;
          }
          while ((localObject == null) || (localObject[1] == 0) || (!((String)localObject[1]).equalsIgnoreCase("-100")));
          i = 2;
        }
        catch (RPCHelper.HttpException localHttpException)
        {
          break label73;
        }
      }
    }

    protected void onCancelled()
    {
      SwitchUser.this.registTaskFree = 1;
    }

    protected void onPostExecute(Integer paramInteger)
    {
      int i = paramInteger.intValue();
      if (i == 1)
        if ((StaticInfo.mUser.gsid == null) || (StaticInfo.mUser.gsid.length() == 0))
        {
          SwitchUser localSwitchUser1 = SwitchUser.this;
          Intent localIntent1 = new Intent(localSwitchUser1, RegisterActivity.class);
          SwitchUser.this.startActivityForResult(localIntent1, 0);
        }
      while (true)
      {
        SwitchUser.this.registTaskFree = 1;
        return;
        SwitchUser localSwitchUser2 = SwitchUser.this;
        Intent localIntent2 = new Intent(localSwitchUser2, WhitListDirect.class);
        String str1 = WhitListDirect.KEY_WL_PASSWORD;
        String str2 = StaticInfo.mPassword;
        Intent localIntent3 = localIntent2.putExtra(str1, str2);
        SwitchUser.this.startActivityForResult(localIntent2, 2);
        continue;
        if (i == 2)
        {
          SwitchUser localSwitchUser3 = SwitchUser.this;
          Intent localIntent4 = new Intent(localSwitchUser3, RegisterActivity.class);
          SwitchUser.this.startActivityForResult(localIntent4, 0);
          continue;
        }
        Toast localToast = Toast.makeText(SwitchUser.this, 2131427593, 1);
        SwitchUser localSwitchUser4 = SwitchUser.this;
        Intent localIntent5 = new Intent(localSwitchUser4, RegisterActivity.class);
        SwitchUser.this.startActivityForResult(localIntent5, 0);
      }
    }
  }

  class SquareItemAdapter extends BaseAdapter
  {
    Context context;
    TextView tvName;

    public SquareItemAdapter(Context arg2)
    {
      Object localObject;
      this.context = localObject;
    }

    public int getCount()
    {
      return 3;
    }

    public Object getItem(int paramInt)
    {
      return Integer.valueOf(paramInt);
    }

    public long getItemId(int paramInt)
    {
      return paramInt;
    }

    public View getView(int paramInt, View paramView, ViewGroup paramViewGroup)
    {
      View localView = ((LayoutInflater)this.context.getSystemService("layout_inflater")).inflate(2130903081, null);
      TextView localTextView1 = (TextView)localView.findViewById(2131623996);
      this.tvName = localTextView1;
      if (paramInt == 0)
      {
        TextView localTextView2 = this.tvName;
        String str1 = SwitchUser.this.getString(2131427416);
        localTextView2.setText(str1);
        localView.setBackgroundResource(2130837576);
      }
      while (true)
      {
        return localView;
        if (paramInt == 1)
        {
          TextView localTextView3 = this.tvName;
          String str2 = SwitchUser.this.getString(2131427417);
          localTextView3.setText(str2);
          localView.setBackgroundResource(2130837568);
          continue;
        }
        TextView localTextView4 = this.tvName;
        String str3 = SwitchUser.this.getString(2131427418);
        localTextView4.setText(str3);
        localView.setBackgroundResource(2130837563);
      }
    }
  }
}

/* Location:           D:\Program Files\eclipse\apktool-r01-3\新浪微博\classes.dex.dex2jar.jar
 * Qualified Name:     com.sina.weibo.SwitchUser
 * JD-Core Version:    0.6.0
 */